package org.example.managere.dto.feibiao;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.Date;

/**
 * 电机设备故障维修记录表数据传输对象
 */
@Data
@NoArgsConstructor
public class AmArchivesFailureDto {
    private Integer failureId;
    
    @NotEmpty(message = "电机ID不能为空")
    private String motorId;
    
    @NotNull(message = "故障时间不能为空")
    private Date failureTime;
    
    @NotEmpty(message = "故障类型不能为空")
    private String failureType;
    
    @NotEmpty(message = "故障描述不能为空")
    private String failureDescription;
    
    @NotEmpty(message = "故障原因不能为空")
    private String failureCause;
    
    private Date repairTime;
    
    private String repairMeasures;
    
    // 添加额外字段以便前端显示
    private String motorType;
    private String manufacturer;
    
    /**
     * 专用于JPQL查询的构造函数，参数顺序必须与查询中完全一致
     */
    public AmArchivesFailureDto(Integer failureId, String motorId, Date failureTime, 
                             String failureType, String failureDescription, String failureCause,
                             Date repairTime, String repairMeasures, 
                             String motorType, String manufacturer) {
        this.failureId = failureId;
        this.motorId = motorId;
        this.failureTime = failureTime;
        this.failureType = failureType;
        this.failureDescription = failureDescription;
        this.failureCause = failureCause;
        this.repairTime = repairTime;
        this.repairMeasures = repairMeasures;
        this.motorType = motorType;
        this.manufacturer = manufacturer;
    }
} 